﻿using TiffLibrary;

namespace WholeSlideImageViewer.TiffExport
{
    internal class TiffExportOptions
    {
        public int TileSize { get; set; }

        public TiffCompression Compression { get; set; }

        public bool LzwUseDifferential { get; set; }

        public bool DeflateUseDifferential { get; set; }

        public int DeflateCompressionLevel { get; set; }

        public bool JpegOptimizeCoding { get; set; }

        public bool JpegUseSharedQuantizationTables { get; set; }

        public bool JpegUseSharedHuffmanTables { get; set; }

        public int ThreadCount { get; set; }

        public string? Software { get; set; }

        public static TiffExportOptions Create(ITiffOutputOptions options)
        {
            return new TiffExportOptions
            {
                TileSize = options.TileSize,
                Compression = options.Compression,
                LzwUseDifferential = options.LzwUseDifferential,
                DeflateUseDifferential = options.DeflateUseDifferential,
                DeflateCompressionLevel = options.DeflateCompressionLevel,
                JpegOptimizeCoding = options.JpegOptimizeCoding,
                JpegUseSharedQuantizationTables = options.JpegUseSharedQuantizationTables,
                JpegUseSharedHuffmanTables = options.JpegUseSharedHuffmanTables,
                ThreadCount = options.ThreadCount
            };
        }
    }
}
